﻿#pragma once
//#include "wx/wxprec.h"
//#include	<wx/log.h>

struct motorInterface
{
	bool (*openCom)(int portnum);
	void (*closeCom)();

	bool (*setDivide)(int d);
	bool (*forward)();//往前一步
	bool (*backword)();
	void (*fastSteps)(unsigned int steps,bool forward);
	void (*selAxis)(bool x);
};

extern serialPort com;


inline bool openCom(int portnum)
{
	if( com.OpenCom(portnum))
	{
		return true;
	}
	return false;
}

inline void closeCom()
{
	com.CloseCom();
}

inline bool send(const char* cmd)
{
	return com.WriteCom(cmd);
}
inline bool read(char* dat)
{
	return com.ReadCom(dat);
}
